package com.qfedu.controller;


import com.qfedu.fmmall.service.UserAddrService;
import com.qfedu.fmmall.vo.ResultVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@CrossOrigin
@RequestMapping("/userAddr")
@Api(tags = "用户地址管理",value = "获取用户的收货地址")
public class UserAddrController {

    @Autowired
    private UserAddrService userAddrService;

    @GetMapping("/list/{userId}")
    @ApiOperation("用户收货地址")
    @ApiImplicitParam(type = "int",name = "userId",value = "用户id",required = true)
    public ResultVo getUserAddr(@PathVariable("userId")Integer userId,
                                @RequestHeader("token")String token){
      return userAddrService.getUserAddrByUid(userId);
    }
}
